var api = require('../../utils/api.js');
var app = getApp();
Page({
    data: {
        banner:[] 
    },
    currentPageNumber: 1,
    onLoad() {
        this.getindexbanner();

    },

    goto(ret){
        console.log(ret)
        var url=ret.currentTarget.dataset.url;

        wx.navigateTo({
          url: url
        })
    },
    onShow() {

     
    },
    getindexbanner(){
        var that=this;
        api.post({
            url: 'index/getbanner',
            data: {},
            success: data => {
                console.log(data);
                that.setData({
                    banner:data.data
                })
            }
        });

    },

    seeall(){
        wx.navigateTo({
          url: '/pages/class/index',
        })
    },

    baoming(){
        wx.navigateTo({
            url: '/pages/moban/index',
          })

    },

    getnews(){
        wx.navigateTo({
            url: '/pages/news/index',
          })

    },

    getkeys(ret){
        this.setData({
            keys:ret.detail.value
        })
    },

    getvideobykye(){
        var key=this.data.keys;
        wx.navigateTo({
            url: '/pages/index/lists?key='+key
          })
    },

    jiafen(){
        wx.navigateTo({
            url: '/pages/tousu/index'
          })
    },
    jinsheng(){
        wx.navigateTo({
            url: '/pages/otehr/jinsheng'
          })
    },
    kaoshi(){
        wx.navigateTo({
          url: '/pages/ziliao/index',
        })
        
    },
    previewImage(e) {
        wx.previewImage({
            current: '', // 当前显示图片的http链接
            urls: [e.currentTarget.dataset.previewUrl] // 需要预览的图片http链接列表
        });

    },
    onShareAppMessage() {
        return {
            title: '好玩的,都在这儿~~',
            path: '/pages/index/index'
        }
    }

});
